<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class CreatePostEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($id, $uid, $contents, $circle_id, $tags, $goods, $image_urls, $video_urls, $address, $videoThumbUrl, $video_width, $video_height)
    {
        $this->id = $id;
        $this->uid = $uid;
        $this->contents = $contents;
        $this->circle_id = $circle_id;
        $this->tags = $tags;
        $this->goods = $goods;
        $this->image_urls = $image_urls;
        $this->video_urls = $video_urls;
        $this->address = $address;
        $this->videoThumbUrl = $videoThumbUrl;
        $this->video_width = $video_width;
        $this->video_height = $video_height;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
